package com.ccrfid.rmc6.repository.alarm;

import com.ccrfid.rmc6.entity.alarm.AlarmNotifyRecordView;
import com.ccrfid.rmc6.pojo.dto.report.AlarmTypeCountDto;
import com.ccrfid.rmc6.repository.search.SearchableRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.query.Param;

import java.sql.Timestamp;
import java.util.List;

public interface AlarmNotifyRecordVeiwRepository extends Repository<AlarmNotifyRecordView, Long>,
        SearchableRepository<AlarmNotifyRecordView> {

    int countAllByNotifyPersonnelIdAndAlarmTypeInAndClosed(Long noyifyPersonnelId, List<Integer> alarmTypeList, Integer closed);
    int countAllByNotifyPersonnelIdAndAlarmTypeInAndRead(Long noyifyPersonnelId, List<Integer> alarmTypeList, Integer read);

    int countAllByNotifyPersonnelIdAndAlarmTypeAndClosed(Long noyifyPersonnelId, Integer alarmType, Integer closed);

    int countAllByNotifyPersonnelIdAndAlarmTypeAndRead(Long noyifyPersonnelId, Integer alarmType, Integer read);

    List<AlarmNotifyRecordView> getAllByNotifyPersonnelId(Long personnelId);

}
